import { requestClient } from '#/api/request';


//新增
export async function createCertificateTempApi(data: any) {
  return requestClient.post('/certification/create-certificate-temp', data);
}

// 编辑
export async function updateCertificateTempApi(data: any) {
  return requestClient.patch('/certification/update-certificate-temp', data);
}

//查询 
export async function getCertificateTempApi(params: any) {
  return requestClient.get('/certification/get-certificate-temp', { params });
}

//删除
export async function deleteCertificateTempApi(id:any) {
  return requestClient.delete(`/certification/delete-certificate-temp/${id}`);
}

// 获取单个模板信息
export async function getCertificationIdApi(id:any) {
  return requestClient.get(`/certification/get-published-latest-certificate-temp-by-certificationId/${id}`);
}

// 预览证书
export async function previewCertificateApi(params: any) {
  return requestClient.post('/certification/preview-example-certificate', params, {
    responseReturn: 'raw',
    responseType: 'blob',
    timeout: 120000,
    headers: {
      'Accept': 'application/octet-stream,application/pdf,image/*,*/*'  // 接受的文件类型
    }
  });
}
// 获取认证没有在证书模板的
export async function getCertificationNoTemplateApi(params: any) {
  return requestClient.get('/certification/get-certification-no-template', { params });
}
